<template>
<div>
  <table>
    <tr>
      <td>内容</td>
      <td>广告</td>
      <td>查看</td>
    </tr>
    <tr v-for="i in newlist">
      <td>{{i.content}}</td>
      <td>{{i.headline}}</td>
      <td>
        <button @click="show(i.id)">查看</button>
      </td>
    </tr>
  </table>
</div>
</template>

<script>
export default {
  name: "new_show_1",
  data(){
    return{
      newlist:[],
      kk:[],
    }
  },
  methods:{
    get_new(){
      this.axios.get('users/get/')
      .then(res=>{
        this.newlist=res.data.list
      })
    },
    show(i){
      if(localStorage.getItem('uuuid')){
        this.axios.post('News',{'userid':localStorage.getItem('uuuid'),'newsid':i})
        .then(res=>{
          this.kk=res.data.list
          console.log(res.data)
        })
      }else {
        this.$router.push('llogin')
      }
    },
  },
  mounted() {
    this.get_new()
  }
}
</script>

<style scoped>

</style>
